import time

from data013.Base.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    #
    iframe_loc = (By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')
    def iframe(self):
        self.frame(self.iframe_loc)
    # 账号
    email_loc = (By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[1]/div[2]/input')
    def email(self,user):
        self.send_keys(self.email_loc,user)
    # 密码
    password_loc = (By.XPATH,'/html/body/div[2]/div[2]/div[2]/form/div/div[3]/div[2]/input[2]')
    def password(self,pase):
        self.send_keys(self.password_loc,pase)
    # 点击登录
    dologin_loc = (By.ID,'dologin')
    def dologin(self):
        self.click(self.dologin_loc)


    def test_126_login(self,user,pase):
        self.open_url('https://126.com/')
        self.iframe()
        self.email(user)
        self.password(pase)
        self.dologin()
        self.content()
        time.sleep(5)

